package org.arestaurant;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class ImageServices {
    public static Bitmap getImageBitMap(String imageUrl) {
        HttpURLConnection conn = ConnectionServices.connectHttp(imageUrl);
        InputStream is = null;
        Bitmap bm = null;
        try {
            is = conn.getInputStream();
            BufferedInputStream bis = new BufferedInputStream(is);
            bm = BitmapFactory.decodeStream(bis);
            bis.close();
            is.close();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return bm;
    }
}
